package com.example.demojenkines.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Classname TestController
 * @Description [ TODO ]
 * @Author Tang
 * @Date 2020/4/7 14:27
 * @Created by ASUS
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @GetMapping("/index")
    public Map<String, String> index() {
        Map<String, String> map = new HashMap<>();
        map.put("username", "tang");
        return map;
    }

    @GetMapping("/error")
    public Map<String, String> error() {
        throw new RuntimeException("请求失败了!");
    }

}